import request from '@/utils/request'
let serviceName = "/user-service"
/**
 * 获取分页数据
 * @param { } keyword 
 */
export function getUsers(keyword) {
    return request({ url: serviceName + "/user/list", method: "post", data: keyword });
}
/**
 * 更新
 * @param {*} id 
 */
export function update(user) {
    return request({ url: serviceName + "/user/update", method: "post", data: user });
}
/**
 * 删除
 * @param {*} id 
 */
export function remove(id) {
    return request({ url: serviceName + "/user/delete", method: "post", params: { "id": id } });
}
/**
 * 根据ID获取
 * @param {*} id 
 */
export function getUser(id) {
    return request({ url: serviceName + "/user/getById", method: "get", params: { "id": id } });
}
/**
 * 添加用户
 * @param {*} user
 */
export function insert(user) {
    return request({ url: serviceName + "/user/insert", method: "post", data: user });
}
/**
 * 上传头像
 */
export function setPhoto(file) {
    return request({
        url: serviceName + "/user/setPhoto",
        method: "post",
        data: file
    })
}